package com.deyuanyun.pic.pbf.controller.dto;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.deyuanyun.pic.common.util.NumberUtil;
import com.deyuanyun.pic.common.util.poi.annotation.ExcelWriteColumn;
import com.deyuanyun.pic.pbf.enumeration.RepairStateEnum;
import com.deyuanyun.pic.settings.domain.base.Attachment;
import com.deyuanyun.pic.settings.support.utils.BaseCodeUtils;

/**
 *  缺陷点信息列表展示dto
 *  @author axiao(xj08.dream@gmail.com)
 *  @date 2016-06-20
 *  @version 1.0
 *  Histroy: [修改人][时间][描述]
 */
public class DefectInfoDTO {
    private String defectId;//缺陷id

    private String code;//统一编号

    private String pipeId;//管道编号
    @ExcelWriteColumn
    private String pipeName;//管道名称

    @ExcelWriteColumn
    private String customNumber;//缺陷编号

    @ExcelWriteColumn
    private String featureType;//缺陷类型

    @ExcelWriteColumn
    private String featureSubType;//缺陷子类型

    @ExcelWriteColumn
    private BigDecimal mileage;//绝对距离(m)

    @ExcelWriteColumn
    private BigDecimal length;//长（mm）

    @ExcelWriteColumn
    private BigDecimal width;//宽（mm）

    @ExcelWriteColumn
    private BigDecimal depth;//深（mm）

    private BigDecimal maxDepth; //峰值深度（%wt）

    @ExcelWriteColumn
    private String clock;//时钟位置

    @ExcelWriteColumn
    private BigDecimal erf;//ERF值

    @ExcelWriteColumn
    private String repairSuggestion;//评价维修建议：立即维修；计划维修；暂不维修；监控

    @ExcelWriteColumn
    private Date planRepairTime;//评价最迟修复时间

    @ExcelWriteColumn
    private String planRepairType;//评价维修方法：玻璃纤维补强；劳伦纤维补强；碳纤维补强；A型套管；B型套管；环氧套管；接管；打磨；补焊；补丁；共具；其他

    @ExcelWriteColumn
    private Date evaluateTime;//评价时间

    @ExcelWriteColumn
    private String assessDepartment;//评价单位

    private String gisId;//GISID，地图需要的编号
    private RepairStateEnum repairState;//维修状态
    private String repairState_label;//维修状态中文
    private String repairTaskId;//维修任务编号
    private String instTaskId;//内检测任务编号 
    
    private List<Attachment> attachmentList;

    public String getRepairState_label() {
        if(repairState == null){
            return "";
        }
        repairState_label = repairState.getLabel();
        return repairState_label;
    }

    
    public void setRepairState_label(String repairState_label) {
        this.repairState_label = repairState_label;
    }


    public String getInstTaskId() {
        return instTaskId;
    }


    public void setInstTaskId(String instTaskId) {
        this.instTaskId = instTaskId;
    }


    public String getRepairTaskId() {
        return repairTaskId;
    }


    public void setRepairTaskId(String repairTaskId) {
        this.repairTaskId = repairTaskId;
    }


    public RepairStateEnum getRepairState() {
        return repairState;
    }

    public void setRepairState(RepairStateEnum repairState) {
        this.repairState = repairState;
    }

    public String getPipeId() {
        return pipeId;
    }

    public void setPipeId(String pipeId) {
        this.pipeId = pipeId;
    }

    public String getDefectId() {
        return defectId;
    }

    public void setDefectId(String defectId) {
        this.defectId = defectId;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getPipeName() {
        return pipeName;
    }

    public void setPipeName(String pipeName) {
        this.pipeName = pipeName;
    }

    public String getCustomNumber() {
        return customNumber;
    }

    public void setCustomNumber(String customNumber) {
        this.customNumber = customNumber;
    }

    public String getFeatureType() {
        return BaseCodeUtils.getName(featureType);
    }

    public void setFeatureType(String featureType) {
        this.featureType = featureType;
    }

    public String getFeatureSubType() {
        return BaseCodeUtils.getName(featureSubType);
    }

    public void setFeatureSubType(String featureSubType) {
        this.featureSubType = featureSubType;
    }

    public BigDecimal getMileage() {
        if(this.mileage != null) {
            return NumberUtil.toBigDecimal(this.mileage, 3);
        } else {
            return null;
        }
    }

    public void setMileage(BigDecimal mileage) {
        this.mileage = mileage;
    }

    public BigDecimal getLength() {
        return length;
    }

    public void setLength(BigDecimal length) {
        this.length = length;
    }

    public BigDecimal getWidth() {
        return width;
    }

    public void setWidth(BigDecimal width) {
        this.width = width;
    }

    public BigDecimal getDepth() {
        return depth;
    }

    public void setDepth(BigDecimal depth) {
        this.depth = depth;
    }

    public BigDecimal getMaxDepth() {
        return maxDepth;
    }

    public void setMaxDepth(BigDecimal maxDepth) {
        this.maxDepth = maxDepth;
    }

    public String getClock() {
        return clock;
    }

    public void setClock(String clock) {
        this.clock = clock;
    }

    public BigDecimal getErf() {
        if(this.erf != null) {
            return NumberUtil.toBigDecimal(this.erf, 2);
        } else {
            return null;
        }
    }

    public void setErf(BigDecimal erf) {
        this.erf = erf;
    }

    public String getRepairSuggestion() {
        return BaseCodeUtils.getName(repairSuggestion);
    }

    public void setRepairSuggestion(String repairSuggestion) {
        this.repairSuggestion = repairSuggestion;
    }

    public Date getPlanRepairTime() {
        return planRepairTime;
    }

    public void setPlanRepairTime(Date planRepairTime) {
        this.planRepairTime = planRepairTime;
    }

    public String getPlanRepairType() {
        return planRepairType;
    }

    public void setPlanRepairType(String planRepairType) {
        this.planRepairType = planRepairType;
    }

    public Date getEvaluateTime() {
        return evaluateTime;
    }

    public void setEvaluateTime(Date evaluateTime) {
        this.evaluateTime = evaluateTime;
    }

    public String getAssessDepartment() {
        return assessDepartment;
    }

    public void setAssessDepartment(String assessDepartment) {
        this.assessDepartment = assessDepartment;
    }

    public String getGisId() {
        return gisId;
    }

    public void setGisId(String gisId) {
        this.gisId = gisId;
    }


    public List<Attachment> getAttachmentList() {
        return attachmentList;
    }


    public void setAttachmentList(List<Attachment> attachmentList) {
        this.attachmentList = attachmentList;
    }

}
